Skip to content

feat: audio format validation aligned with latest T2A API#127

Merged
RyanLee-Dev merged 2 commits into
mainfrom
feat/audio-format-validation
May 11, 2026
Merged

feat: audio format validation aligned with latest T2A API#127
RyanLee-Dev merged 2 commits into
mainfrom
feat/audio-format-validation

Conversation

@RyanLee-Dev
Copy link
Copy Markdown
Collaborator

Summary

  • Centralized audio format validation in src/utils/audio-formats.ts with per-API domain format sets
  • T2A (speech): supports all 7 documented formats — mp3, pcm, flac, wav, pcmu_raw, pcmu_wav, opus
  • Music (generate/cover): supports mp3, wav, pcm, flac
  • Enforces streaming constraint: wav rejected in --stream mode for T2A (API only supports wav in non-streaming)
  • Help text dynamically generated from format lists
  • Fixes all pre-existing lint errors across test files

Supersedes #116 — addresses missing pcmu_raw/pcmu_wav formats, separates T2A vs Music format sets, adds streaming constraint.

Test plan

  • All 7 T2A formats accepted via dry-run
  • All 4 music formats accepted via dry-run
  • Invalid format rejected with clear error message
  • --stream --format wav rejected for speech
  • bun test — 185 pass, 0 fail
  • bun run lint — 0 errors, 0 warnings

Separate format sets per API domain (T2A supports 7 formats including
pcmu_raw, pcmu_wav, opus; Music supports mp3, wav, pcm, flac) with
streaming constraint enforcement for T2A wav.
- Replace require() with dynamic import in timeout-fix test
- Fix unused variable in stream test
- Replace no-explicit-any casts with Config type in models test
@RyanLee-Dev RyanLee-Dev merged commit 9282631 into main May 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant